/*
 * @lc app=leetcode.cn id=2315 lang=typescript
 *
 * [2315] 统计星号
 */

// @lc code=start
function countAsterisks(s: string): number {
    let isInLine = false;
    let count = 0;
    for (let i = 0; i < s.length; i++) {
        const element = s[i];
        if (!isInLine && element === "*") {
            count++;
        }
        if (element === "|") {
            isInLine = !isInLine;
        }
    }
    return count;
}
// @lc code=end
